import { http } from '@/utils'

export type Wallpaper = {
    id: number,
    createTime: string,
    updateTime?: string,
    imageCode?: string,
    tempImageUrl?: string,
    thumbImageUrl?: string,
    downloadImageUrl?: string,
    downloadCount?: number,
    deleted: boolean,
    categoryId: number,
    searchKeywords: string
}

export type WallpaperRes = {
    total: number,
    list: Wallpaper[]
}

export type WallpaperParams = {
    pageSize?: number,
    pageNo?: number,
    categoryId?: number | string
}

/**
 * 壁纸列表
 */
export const fetchWallpaperListAPI = (params: WallpaperParams) => {
    return http<WallpaperRes>({
        url: 'wallpaper/list',
        params
    })
}